
package com.fis.mca.persistence;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import com.fis.mca.util.StringUtil;


/**
 * <p>Java class for timeZone complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="timeZone">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="chargeBandVersions" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="fromDay" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         &lt;element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="timeZoneId" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         &lt;element name="toDay" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "timeZone", propOrder = {
    "chargeBandVersions",
    "fromDay",
    "status",
    "timeZoneId",
    "toDay"
})
public class TimeZone implements Comparable<TimeZone>{

    @XmlElement(nillable = true)
    protected List<Object> chargeBandVersions;
    protected int fromDay;
    protected String status;
    protected int timeZoneId;
    protected int toDay;

    /**
     * Gets the value of the chargeBandVersions property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the chargeBandVersions property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getChargeBandVersions().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getChargeBandVersions() {
        if (chargeBandVersions == null) {
            chargeBandVersions = new ArrayList<Object>();
        }
        return this.chargeBandVersions;
    }

    /**
     * Gets the value of the fromDay property.
     * 
     */
    public int getFromDay() {
        return fromDay;
    }

    /**
     * Sets the value of the fromDay property.
     * 
     */
    public void setFromDay(int value) {
        this.fromDay = value;
    }

    /**
     * Gets the value of the status property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getStatus() {
        return status;
    }

    /**
     * Sets the value of the status property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setStatus(String value) {
        this.status = value;
    }

    /**
     * Gets the value of the timeZoneId property.
     * 
     */
    public int getTimeZoneId() {
        return timeZoneId;
    }

    /**
     * Sets the value of the timeZoneId property.
     * 
     */
    public void setTimeZoneId(int value) {
        this.timeZoneId = value;
    }

    /**
     * Gets the value of the toDay property.
     * 
     */
    public int getToDay() {
        return toDay;
    }

    /**
     * Sets the value of the toDay property.
     * 
     */
    public void setToDay(int value) {
        this.toDay = value;
    }
    
    public String toString(){
    	return fromDay+"-"+toDay;
    }
    public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if ((obj == null) || (obj.getClass() != this.getClass()))
		{
			return false;
		}
		// object must be Test at this point
		TimeZone tz = (TimeZone) obj;
		return timeZoneId == tz.getTimeZoneId();
	}

	@Override
	public int compareTo(TimeZone o)
	{
		int re = this.getFromDay() - o.getFromDay();
		
		if (re == 0)
		{
			re = this.getToDay() - o.getToDay();
		}
		
		return re;
	}

}
